package com.example.demo.Controller;

import com.example.demo.Mapper.CustomerMapper;
import com.example.demo.pojo.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

@RestController
public class applyController {
    @Autowired
    CustomerMapper customerMapper;
    @RequestMapping("/admin/applytrial")
    public Boolean trial(Customer customer){
        customer.setId(new Random().nextInt(9999999)+1000000);
        return  customerMapper.insert(customer) > 0 ?true : false;
    }
}
